home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.42 / includes3v1 / includes3v1.lha / Intuition / Intuition.i < prev    next >
Text File  |  1994-12-04  |  82KB  |  2,134 lines

  1. { Intuition.i }
  2.  
  3.  
  4. {$I   "Include:Exec/Types.i"}
  5. {$I   "Include:Graphics/Gfx.i"}
  6. {$I   "Include:Graphics/Clip.i"}
  7. {$I   "Include:Graphics/View.i"}
  8. {$I   "Include:Graphics/RastPort.i"}
  9. {$I   "Include:Graphics/Layers.i"}
  10. {$I   "Include:Graphics/Text.i"}
  11. {$I   "Include:Exec/Ports.i"}
  12. {$I   "Include:Devices/InputEvent.i"}
  13. {$I   "Include:Utility/TagItem.i"}
  14. {
  15.  * NOTE:  intuition/iobsolete.h is included at the END of this file!
  16.  }
  17.  
  18. { ======================================================================== }
  19. { === IntuiText ========================================================== }
  20. { ================================= ======================================= }
  21. { IntuiText is a series of strings that start with a screen location
  22.  *  (always relative to the upper-left corner of something) and then the
  23.  *  text of the string.  The text is null-terminated.
  24.  }
  25. Type
  26.     IntuiText = record
  27.         FrontPen,
  28.         BackPen         : Byte;         { the pen numbers for the rendering }
  29.         DrawMode        : Byte;         { the mode for rendering the text }
  30.         LeftEdge        : Short;        { relative start location for the text }
  31.         TopEdge         : Short;        { relative start location for the text }
  32.         ITextFont       : TextAttrPtr;  { if NULL, you accept the default }
  33.         IText           : String;       { pointer to null-terminated text }
  34.         NextText        : ^IntuiText;   { continuation to TxWrite another text }
  35.     end;
  36.     IntuiTextPtr = ^IntuiText;
  37.  
  38.  
  39.  
  40. { ======================================================================== }
  41. { === Border ============================================================= }
  42. { ======================================================================== }
  43. { Data type Border, used for drawing a series of lines which is intended for
  44.  *  use as a border drawing, but which may, in fact, be used to render any
  45.  *  arbitrary vector shape.
  46.  *  The routine DrawBorder sets up the RastPort with the appropriate
  47.  *  variables, then does a Move to the first coordinate, then does Draws
  48.  *  to the subsequent coordinates.
  49.  *  After all the Draws are done, if NextBorder is non-zero we call DrawBorder
  50.  *  recursively
  51.  }
  52. Type
  53.     Border = record
  54.         LeftEdge,
  55.         TopEdge         : Short;        { initial offsets from the origin }
  56.         FrontPen,
  57.         BackPen         : Byte;         { pens numbers for rendering }
  58.         DrawMode        : Byte;         { mode for rendering }
  59.         Count           : Byte;         { number of XY pairs }
  60.         XY              : Address;      { vector coordinate pairs rel to LeftTop}
  61.         NextBorder      : ^Border;      { pointer to any other Border too }
  62.     end;
  63.     BorderPtr = ^Border;
  64.  
  65.  
  66.  
  67.  
  68. Type
  69.  
  70. { ======================================================================== }
  71. { === MenuItem =========================================================== }
  72. { ======================================================================== }
  73.  
  74. Type
  75.  
  76.     MenuItem = record
  77.         NextItem        : ^MenuItem;    { pointer to next in chained list }
  78.         LeftEdge,
  79.         TopEdge         : Short;        { position of the select box }
  80.         Width,
  81.         Height          : Short;        { dimensions of the select box }
  82.         Flags           : Short;        { see the defines below }
  83.  
  84.         MutualExclude   : Integer;      { set bits mean this item excludes that }
  85.  
  86.         ItemFill        : Address;      { points to Image, IntuiText, or NULL }
  87.  
  88.     { when this item is pointed to by the cursor and the items highlight
  89.      *  mode HIGHIMAGE is selected, this alternate image will be displayed
  90.      }
  91.  
  92.         SelectFill      : Address;      { points to Image, IntuiText, or NULL }
  93.  
  94.         Command         : Char;         { only if appliprog sets the COMMSEQ flag }
  95.  
  96.         SubItem         : ^MenuItem;    { if non-zero, DrawMenu shows "->" }
  97.  
  98.     { The NextSelect field represents the menu number of next selected
  99.      *  item (when user has drag-selected several items)
  100.      }
  101.  
  102.         NextSelect      : Short;
  103.     end;
  104.     MenuItemPtr = ^MenuItem;
  105.  
  106.  
  107. Const
  108.  
  109. { FLAGS SET BY THE APPLIPROG }
  110.     CHECKIT     = $0001;        { whether to check this item if selected }
  111.     ITEMTEXT    = $0002;        { set if textual, clear if graphical item }
  112.     COMMSEQ     = $0004;        { set if there's an command sequence }
  113.     MENUTOGGLE  = $0008;        { set to toggle the check of a menu item }
  114.     ITEMENABLED = $0010;        { set if this item is enabled }
  115.  
  116. { these are the SPECIAL HIGHLIGHT FLAG state meanings }
  117.     HIGHFLAGS   = $00C0;        { see definitions below for these bits }
  118.     HIGHIMAGE   = $0000;        { use the user's "select image" }
  119.     HIGHCOMP    = $0040;        { highlight by complementing the selectbox }
  120.     HIGHBOX     = $0080;        { highlight by "boxing" the selectbox }
  121.     HIGHNONE    = $00C0;        { don't highlight }
  122.  
  123. { FLAGS SET BY BOTH APPLIPROG AND INTUITION }
  124.     CHECKED     = $0100;        { if CHECKIT, then set this when selected }
  125.  
  126. { FLAGS SET BY INTUITION }
  127.     ISDRAWN     = $1000;        { this item's subs are currently drawn }
  128.     HIGHITEM    = $2000;        { this item is currently highlighted }
  129.     MENUTOGGLED = $4000;        { this item was already toggled }
  130.  
  131.  
  132. { ======================================================================== }
  133. { === Menu =============================================================== }
  134. { ======================================================================== }
  135. Type
  136.  
  137.     Menu = record
  138.         NextMenu        : ^Menu;        { same level }
  139.         LeftEdge,
  140.         TopEdge         : Short;        { position of the select box }
  141.         Width,
  142.         Height          : Short;        { dimensions of the select box }
  143.         Flags           : Short;        { see flag definitions below }
  144.         MenuName        : String;       { text for this Menu Header }
  145.         FirstItem       : MenuItemPtr;  { pointer to first in chain }
  146.  
  147.     { these mysteriously-named variables are for internal use only }
  148.  
  149.         JazzX,
  150.         JazzY,
  151.         BeatX,
  152.         BeatY           : Short;
  153.     end;
  154.     MenuPtr = ^Menu;
  155.  
  156. CONST
  157. { FLAGS SET BY BOTH THE APPLIPROG AND INTUITION }
  158.     MENUENABLED = $0001;        { whether or not this menu is enabled }
  159.  
  160. { FLAGS SET BY INTUITION }
  161.     MIDRAWN     = $0100;        { this menu's items are currently drawn }
  162.  
  163.  
  164.  
  165.  
  166. { ======================================================================== }
  167. { === Gadget ============================================================= }
  168. { ======================================================================== }
  169.  
  170. Type
  171.  
  172.     Gadget = record
  173.         NextGadget      : ^Gadget;      { next gadget in the list }
  174.  
  175.         LeftEdge,
  176.         TopEdge         : Short;        { "hit box" of gadget }
  177.         Width,
  178.         Height          : Short;        { "hit box" of gadget }
  179.  
  180.         Flags           : Short;        { see below for list of defines }
  181.  
  182.         Activation      : Short;        { see below for list of defines }
  183.  
  184.         GadgetType      : Short;        { see below for defines }
  185.  
  186.     { appliprog can specify that the Gadget be rendered as either as Border
  187.      * or an Image.  This variable points to which (or equals NULL if there's
  188.      * nothing to be rendered about this Gadget)
  189.      }
  190.  
  191.         GadgetRender    : Address;
  192.  
  193.     { appliprog can specify "highlighted" imagery rather than algorithmic
  194.      * this can point to either Border or Image data
  195.      }
  196.  
  197.         SelectRender    : Address;
  198.  
  199.         GadgetText      : IntuiTextPtr; { text for this gadget }
  200.  
  201.     { by using the MutualExclude word, the appliprog can describe
  202.      * which gadgets mutually-exclude which other ones.  The bits
  203.      * in MutualExclude correspond to the gadgets in object containing
  204.      * the gadget list.  If this gadget is selected and a bit is set
  205.      * in this gadget's MutualExclude and the gadget corresponding to
  206.      * that bit is currently selected (e.g. bit 2 set and gadget 2
  207.      * is currently selected) that gadget must be unselected.
  208.      * Intuition does the visual unselecting (with checkmarks) and
  209.      * leaves it up to the program to unselect internally
  210.      }
  211.  
  212.         MutualExclude   : Integer;      { set bits mean this gadget excludes that gadget }
  213.  
  214.     { pointer to a structure of special data required by Proportional,
  215.      * String and Integer Gadgets
  216.      }
  217.  
  218.         SpecialInfo     : Address;
  219.  
  220.         GadgetID        : Short;        { user-definable ID field }
  221.         UserData        : Address;      { ptr to general purpose User data (ignored by In) }
  222.     end;
  223.     GadgetPtr = ^Gadget;
  224.  
  225.  ExtGadget = Record
  226.     { The first fields match struct Gadget exactly }
  227.     NextGadget     : ^ExtGadget;  { Matches struct Gadget }
  228.     LeftEdge, TopEdge,            { Matches struct Gadget }
  229.     Width, Height,                { Matches struct Gadget }
  230.     Flags,                        { Matches struct Gadget }
  231.     Activation,                   { Matches struct Gadget }
  232.     GadgetType     : WORD;        { Matches struct Gadget }
  233.     GadgetRender,                 { Matches struct Gadget }
  234.     SelectRender   : Address;     { Matches struct Gadget }
  235.     GadgetText     : IntuiTextPtr;{ Matches struct Gadget }
  236.     MutualExclude  : Integer;     { Matches struct Gadget }
  237.     SpecialInfo    : Address;     { Matches struct Gadget }
  238.     GadgetID       : WORD;        { Matches struct Gadget }
  239.     UserData       : Address;     { Matches struct Gadget }
  240.  
  241.     { These fields only exist under V39 and only if GFLG_EXTENDED is set }
  242.     MoreFlags      : Integer;   { see GMORE_ flags below }
  243.     BoundsLeftEdge,             { Bounding extent for gadget, valid   }
  244.     BoundsTopEdge,              { only if GMORE_BOUNDS is set.  The   }
  245.     BoundsWidth,                { GFLG_RELxxx flags affect these      }
  246.     BoundsHeight   : WORD;      { coordinates as well.        }
  247.  end;
  248.  ExtGadgetPtr = ^ExtGadget;
  249.  
  250.  
  251. CONST
  252. { --- Gadget.Flags values      --- }
  253. { combinations in these bits describe the highlight technique to be used }
  254.  GFLG_GADGHIGHBITS  = $0003;
  255.  GFLG_GADGHCOMP     = $0000;  { Complement the select box }
  256.  GFLG_GADGHBOX      = $0001;  { Draw a box around the image }
  257.  GFLG_GADGHIMAGE    = $0002;  { Blast in this alternate image }
  258.  GFLG_GADGHNONE     = $0003;  { don't highlight }
  259.  
  260.  GFLG_GADGIMAGE     = $0004;  { set IF GadgetRender AND SelectRender
  261.                                    * point to an Image structure, clear
  262.                                    * if they point to Border structures
  263.                                    }
  264.  
  265. { combinations in these next two bits specify to which corner the gadget's
  266.  *  Left & Top coordinates are relative.  If relative to Top/Left,
  267.  *  these are "normal" coordinates (everything is relative to something in
  268.  *  this universe).
  269.  *
  270.  * Gadget positions and dimensions are relative to the window or
  271.  * requester which contains the gadget
  272.  }
  273.  GFLG_RELBOTTOM   = $0008;  { vert. pos. is relative to bottom edge }
  274.  GFLG_RELRIGHT    = $0010;  { horiz. pos. is relative to right edge }
  275.  GFLG_RELWIDTH    = $0020;  { width is relative to req/window    }
  276.  GFLG_RELHEIGHT   = $0040;  { height is relative to req/window   }
  277.  
  278. { New for V39: GFLG_RELSPECIAL allows custom gadget implementors to
  279.  * make gadgets whose position and size depend in an arbitrary way
  280.  * on their window's dimensions.  The GM_LAYOUT method will be invoked
  281.  * for such a gadget (or any other GREL_xxx gadget) at suitable times,
  282.  * such as when the window opens or the window's size changes.
  283.  }
  284.  GFLG_RELSPECIAL  = $4000;  { custom gadget has special relativity.
  285.                                    * Gadget box values are absolutes, but
  286.                                    * can be changed via the GM_LAYOUT method.
  287.                                    }
  288.  
  289.  GFLG_SELECTED    = $0080;  { you may initialize AND look at this        }
  290.  
  291. { the GFLG_DISABLED flag is initialized by you and later set by Intuition
  292.  * according to your calls to On/OffGadget().  It specifies whether or not
  293.  * this Gadget is currently disabled from being selected
  294.  }
  295.  GFLG_DISABLED    = $0100;
  296.  
  297. { These flags specify the type of text field that Gadget.GadgetText
  298.  * points to.  In all normal (pre-V36) gadgets which you initialize
  299.  * this field should always be zero.  Some types of gadget objects
  300.  * created from classes will use these fields to keep track of
  301.  * types of labels/contents that different from IntuiText, but are
  302.  * stashed in GadgetText.
  303.  }
  304.  
  305.  GFLG_LABELMASK   = $3000;
  306.  GFLG_LABELITEXT  = $0000;  { GadgetText points to IntuiText     }
  307.  GFLG_LABELSTRING = $1000;  { GadgetText points to (UBYTE *)     }
  308.  GFLG_LABELIMAGE  = $2000;  { GadgetText points to Image (object)        }
  309.  
  310. { New for V37: GFLG_TABCYCLE }
  311.  GFLG_TABCYCLE    = $0200;  { (string OR custom) gadget participates in
  312.                                    * cycling activation with Tab or Shift-Tab
  313.                                    }
  314. { New for V37: GFLG_STRINGEXTEND.  We discovered that V34 doesn't properly
  315.  * ignore the value we had chosen for the Gadget->Activation flag
  316.  * GACT_STRINGEXTEND.  NEVER SET THAT FLAG WHEN RUNNING UNDER V34.
  317.  * The Gadget->Flags bit GFLG_STRINGEXTEND is provided as a synonym which is
  318.  * safe under V34, and equivalent to GACT_STRINGEXTEND under V37.
  319.  * (Note that the two flags are not numerically equal)
  320.  }
  321.  GFLG_STRINGEXTEND = $0400;  { this String Gadget has StringExtend        }
  322.  
  323. { New for V39: GFLG_IMAGEDISABLE.  This flag is automatically set if
  324.  * the custom image of this gadget knows how to do disabled rendering
  325.  * (more specifically, if its IA_SupportsDisable attribute is TRUE).
  326.  * Intuition uses this to defer the ghosting to the image-class,
  327.  * instead of doing it itself (the old compatible way).
  328.  * Do not set this flag yourself - Intuition will do it for you.
  329.  }
  330.  
  331.  GFLG_IMAGEDISABLE = $0800;  { Gadget's image knows how to do disabled
  332.                                    * rendering
  333.                                    }
  334.  
  335. { New for V39:  If set, this bit means that the Gadget is actually
  336.  * a struct ExtGadget, with new fields and flags.  All V39 boopsi
  337.  * gadgets are ExtGadgets.  Never ever attempt to read the extended
  338.  * fields of a gadget if this flag is not set.
  339.  }
  340.  GFLG_EXTENDED    = $8000;  { Gadget is extended }
  341.  
  342. { ---  Gadget.Activation flag values   --- }
  343. { Set GACT_RELVERIFY if you want to verify that the pointer was still over
  344.  * the gadget when the select button was released.  Will cause
  345.  * an IDCMP_GADGETUP message to be sent if so.
  346.  }
  347.  GACT_RELVERIFY    = $0001;
  348.  
  349. { the flag GACT_IMMEDIATE, when set, informs the caller that the gadget
  350.  *  was activated when it was activated.  This flag works in conjunction with
  351.  *  the GACT_RELVERIFY flag
  352.  }
  353.  GACT_IMMEDIATE    = $0002;
  354.  
  355. { the flag GACT_ENDGADGET, when set, tells the system that this gadget,
  356.  * when selected, causes the Requester to be ended.  Requesters
  357.  * that are ended are erased and unlinked from the system.
  358.  }
  359.  GACT_ENDGADGET    = $0004;
  360.  
  361. { the GACT_FOLLOWMOUSE flag, when set, specifies that you want to receive
  362.  * reports on mouse movements while this gadget is active.
  363.  * You probably want to set the GACT_IMMEDIATE flag when using
  364.  * GACT_FOLLOWMOUSE, since that's the only reasonable way you have of
  365.  * learning why Intuition is suddenly sending you a stream of mouse
  366.  * movement events.  If you don't set GACT_RELVERIFY, you'll get at
  367.  * least one Mouse Position event.
  368.  }
  369.  GACT_FOLLOWMOUSE = $0008;
  370.  
  371. { if any of the BORDER flags are set in a Gadget that's included in the
  372.  * Gadget list when a Window is opened, the corresponding Border will
  373.  * be adjusted to make room for the Gadget
  374.  }
  375.  GACT_RIGHTBORDER = $0010;
  376.  GACT_LEFTBORDER  = $0020;
  377.  GACT_TOPBORDER   = $0040;
  378.  GACT_BOTTOMBORDER= $0080;
  379.  GACT_BORDERSNIFF = $8000;  { neither set nor rely on this bit   }
  380.  
  381.  GACT_TOGGLESELECT= $0100;  { this bit for toggle-select mode }
  382.  GACT_BOOLEXTEND  = $2000;  { this Boolean Gadget has a BoolInfo }
  383.  
  384. { should properly be in StringInfo, but aren't }
  385.  GACT_STRINGLEFT  = $0000;  { NOTE WELL: that this has value zero        }
  386.  GACT_STRINGCENTER= $0200;
  387.  GACT_STRINGRIGHT = $0400;
  388.  GACT_LONGINT     = $0800;  { this String Gadget is for Long Ints        }
  389.  GACT_ALTKEYMAP   = $1000;  { this String has an alternate keymap        }
  390.  GACT_STRINGEXTEND= $2000;  { this String Gadget has StringExtend        }
  391.                                   { NOTE: NEVER SET GACT_STRINGEXTEND IF YOU
  392.                                    * ARE RUNNING ON LESS THAN V36!  SEE
  393.                                    * GFLG_STRINGEXTEND (ABOVE) INSTEAD
  394.                                    }
  395.  
  396.  GACT_ACTIVEGADGET = $4000;  { this gadget is "active".  This flag
  397.                                    * is maintained by Intuition, and you
  398.                                    * cannot count on its value persisting
  399.                                    * while you do something on your program's
  400.                                    * task.  It can only be trusted by
  401.                                    * people implementing custom gadgets
  402.                                    }
  403.  
  404. { note $8000 is used above (GACT_BORDERSNIFF);
  405.  * all Activation flags defined }
  406.  
  407. { --- GADGET TYPES ------------------------------------------------------- }
  408. { These are the Gadget Type definitions for the variable GadgetType
  409.  * gadget number type MUST start from one.  NO TYPES OF ZERO ALLOWED.
  410.  * first comes the mask for Gadget flags reserved for Gadget typing
  411.  }
  412.  GTYP_GADGETTYPE = $FC00;  { all Gadget Global Type flags (padded) }
  413.  GTYP_SYSGADGET  = $8000;  { 1 = Allocated by the system, 0 = by app. }
  414.  GTYP_SCRGADGET  = $4000;  { 1 = ScreenGadget, 0 = WindowGadget }
  415.  GTYP_GZZGADGET  = $2000;  { 1 = for WFLG_GIMMEZEROZERO borders }
  416.  GTYP_REQGADGET  = $1000;  { 1 = this is a Requester Gadget }
  417. { system gadgets }
  418.  GTYP_SIZING     = $0010;
  419.  GTYP_WDRAGGING  = $0020;
  420.  GTYP_SDRAGGING  = $0030;
  421.  GTYP_WUPFRONT   = $0040;
  422.  GTYP_SUPFRONT   = $0050;
  423.  GTYP_WDOWNBACK  = $0060;
  424.  GTYP_SDOWNBACK  = $0070;
  425.  GTYP_CLOSE      = $0080;
  426. { application gadgets }
  427.  GTYP_BOOLGADGET = $0001;
  428.  GTYP_GADGET0002 = $0002;
  429.  GTYP_PROPGADGET = $0003;
  430.  GTYP_STRGADGET  = $0004;
  431.  GTYP_CUSTOMGADGET    =   $0005;
  432.  
  433.  
  434. {* GTYP_GTYPEMASK is a mask you can apply to tell what class
  435.  * of gadget this is.  The possible classes follow.
  436.  *}
  437.  GTYP_GTYPEMASK        =  $0007;
  438.  
  439. { This bit in GadgetType is reserved for undocumented internal use
  440.  * by the Gadget Toolkit, and cannot be used nor relied on by
  441.  * applications:        $0100;
  442.  }
  443.  
  444. { New for V39.  Gadgets which have the GFLG_EXTENDED flag set are
  445.  * actually ExtGadgets, which have more flags.  The GMORE_xxx
  446.  * identifiers describe those flags.  For GMORE_SCROLLRASTER, see
  447.  * important information in the ScrollWindowRaster() autodoc.
  448.  * NB: GMORE_SCROLLRASTER must be set before the gadget is
  449.  * added to a window.
  450.  }
  451.  GMORE_BOUNDS       = $00000001; { ExtGadget has valid Bounds }
  452.  GMORE_GADGETHELP   = $00000002; { This gadget responds to gadget help }
  453.  GMORE_SCROLLRASTER = $00000004; { This (custom) gadget uses ScrollRaster }
  454.  
  455. { ======================================================================== }
  456. { === BoolInfo======================================================= }
  457. { ======================================================================== }
  458. { This is the special data needed by an Extended Boolean Gadget
  459.  * Typically this structure will be pointed to by the Gadget field SpecialInfo
  460.  }
  461. Type
  462.     BoolInfo = record
  463.         Flags   : Short;        { defined below }
  464.         Mask    : Address; { bit mask for highlighting and selecting
  465.                          * mask must follow the same rules as an Image
  466.                          * plane.  It's width and height are determined
  467.                          * by the width and height of the gadget's
  468.                          * select box. (i.e. Gadget.Width and .Height).
  469.                          }
  470.         Reserved : Integer;     { set to 0      }
  471.     end;
  472.     BoolInfoPtr = ^BoolInfo;
  473.  
  474. Const
  475.  
  476. { set BoolInfo.Flags to this flag bit.
  477.  * in the future, additional bits might mean more stuff hanging
  478.  * off of BoolInfo.Reserved.
  479. }
  480.     BOOLMASK    = $0001;        { extension is for masked gadget }
  481.  
  482. { ======================================================================== }
  483. { === PropInfo =========================================================== }
  484. { ======================================================================== }
  485. { this is the special data required by the proportional Gadget
  486.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  487.  }
  488.  
  489. Type
  490.  
  491.     PropInfo = record
  492.         Flags   : Short;        { general purpose flag bits (see defines below) }
  493.  
  494.     { You initialize the Pot variables before the Gadget is added to
  495.      * the system.  Then you can look here for the current settings
  496.      * any time, even while User is playing with this Gadget.  To
  497.      * adjust these after the Gadget is added to the System, use
  498.      * ModifyProp();  The Pots are the actual proportional settings,
  499.      * where a value of zero means zero and a value of MAXPOT means
  500.      * that the Gadget is set to its maximum setting.
  501.      }
  502.  
  503.         HorizPot        : WORD; { 16-bit FixedPoint horizontal quantity percentage }
  504.         VertPot         : WORD; { 16-bit FixedPoint vertical quantity percentage }
  505.  
  506.     { the 16-bit FixedPoint Body variables describe what percentage of
  507.      * the entire body of stuff referred to by this Gadget is actually
  508.      * shown at one time.  This is used with the AUTOKNOB routines,
  509.      * to adjust the size of the AUTOKNOB according to how much of
  510.      * the data can be seen.  This is also used to decide how far
  511.      * to advance the Pots when User hits the Container of the Gadget.
  512.      * For instance, if you were controlling the display of a 5-line
  513.      * Window of text with this Gadget, and there was a total of 15
  514.      * lines that could be displayed, you would set the VertBody value to
  515.      *     (MAXBODY / (TotalLines / DisplayLines)) = MAXBODY / 3.
  516.      * Therefore, the AUTOKNOB would fill 1/3 of the container, and
  517.      * if User hits the Cotainer outside of the knob, the pot would
  518.      * advance 1/3 (plus or minus) If there's no body to show, or
  519.      * the total amount of displayable info is less than the display area,
  520.      * set the Body variables to the MAX.  To adjust these after the
  521.      * Gadget is added to the System, use ModifyProp();
  522.      }
  523.  
  524.         HorizBody       : Short;        { horizontal Body }
  525.         VertBody        : Short;        { vertical Body }
  526.  
  527.     { these are the variables that Intuition sets and maintains }
  528.  
  529.         CWidth          : Short;        { Container width (with any relativity absoluted) }
  530.         CHeight         : Short;        { Container height (with any relativity absoluted) }
  531.         HPotRes,
  532.         VPotRes         : Short;        { pot increments }
  533.         LeftBorder      : Short;        { Container borders }
  534.         TopBorder       : Short;        { Container borders }
  535.     end;
  536.     PropInfoPtr = ^PropInfo;
  537.  
  538. CONST
  539. { --- FLAG BITS ---------------------------------------------------------- }
  540.  AUTOKNOB     =   $0001;  { this flag sez:  gimme that old auto-knob }
  541. { NOTE: if you do not use an AUTOKNOB for a proportional gadget,
  542.  * you are currently limited to using a single Image of your own
  543.  * design: Intuition won't handle a linked list of images as
  544.  * a proportional gadget knob.
  545.  }
  546.  
  547.  FREEHORIZ     =  $0002;  { IF set, the knob can move horizontally }
  548.  FREEVERT      =  $0004;  { IF set, the knob can move vertically }
  549.  PROPBORDERLESS =  $0008;  { IF set, no border will be rendered }
  550.  KNOBHIT       =  $0100;  { set when this Knob is hit }
  551.  PROPNEWLOOK   =  $0010;  { set this IF you want to get the new
  552.                                  * V36 look
  553.                                  }
  554.  
  555.  KNOBHMIN      =  6;       { minimum horizontal size of the Knob }
  556.  KNOBVMIN      =  4;       { minimum vertical size of the Knob }
  557.  MAXBODY       =  $FFFF;  { maximum body value }
  558.  MAXPOT        =  $FFFF;  { maximum pot value }
  559.  
  560. { ======================================================================== }
  561. { === StringInfo ========================================================= }
  562. { ======================================================================== }
  563. { this is the special data required by the string Gadget
  564.  * typically, this data will be pointed to by the Gadget variable SpecialInfo
  565.  }
  566.  
  567. Type
  568.  
  569.     StringInfo = record
  570.     { you initialize these variables, and then Intuition maintains them }
  571.         Buffer          : String;       { the buffer containing the start and final string }
  572.         UndoBuffer      : String;       { optional buffer for undoing current entry }
  573.         BufferPos       : Short;        { character position in Buffer }
  574.         MaxChars        : Short;        { max number of chars in Buffer (including NULL) }
  575.         DispPos         : Short;        { Buffer position of first displayed character }
  576.  
  577.     { Intuition initializes and maintains these variables for you }
  578.  
  579.         UndoPos         : Short;        { character position in the undo buffer }
  580.         NumChars        : Short;        { number of characters currently in Buffer }
  581.         DispCount       : Short;        { number of whole characters visible in Container }
  582.         CLeft,
  583.         CTop            : Short;        { topleft offset of the container }
  584.         Layer           : LayerPtr;     { the RastPort containing this Gadget }
  585.  
  586.     { you can initialize this variable before the gadget is submitted to
  587.      * Intuition, and then examine it later to discover what integer
  588.      * the user has entered (if the user never plays with the gadget,
  589.      * the value will be unchanged from your initial setting)
  590.      }
  591.  
  592.         LongInt         : Integer;
  593.  
  594.     { If you want this Gadget to use your own Console keymapping, you
  595.      * set the ALTKEYMAP bit in the Activation flags of the Gadget, and then
  596.      * set this variable to point to your keymap.  If you don't set the
  597.      * ALTKEYMAP, you'll get the standard ASCII keymapping.
  598.      }
  599.  
  600.         AltKeyMap       : Address;
  601.     end;
  602.     StringInfoPtr = ^StringInfo;
  603.  
  604.  
  605. { ======================================================================== }
  606. { === Requester ========================================================== }
  607. { ======================================================================== }
  608.  
  609. Type
  610.  
  611.     Requester = record
  612.     { the ClipRect and BitMap and used for rendering the requester }
  613.         OlderRequest    : ^Requester;
  614.         LeftEdge,
  615.         TopEdge         : Short;        { dimensions of the entire box }
  616.         Width,
  617.         Height          : Short;        { dimensions of the entire box }
  618.         RelLeft,
  619.         RelTop          : Short;        { for Pointer relativity offsets }
  620.  
  621.         ReqGadget       : GadgetPtr;    { pointer to a list of Gadgets }
  622.         ReqBorder       : BorderPtr;    { the box's border }
  623.         ReqText         : IntuiTextPtr; { the box's text }
  624.         Flags           : Short;        { see definitions below }
  625.  
  626.     { pen number for back-plane fill before draws }
  627.  
  628.         BackFill        : Byte;
  629.  
  630.     { Layer in place of clip rect       }
  631.  
  632.         ReqLayer        : LayerPtr;
  633.  
  634.         ReqPad1         : Array [0..31] of Byte;
  635.  
  636.     { If the BitMap plane pointers are non-zero, this tells the system
  637.      * that the image comes pre-drawn (if the appliprog wants to define
  638.      * it's own box, in any shape or size it wants!);  this is OK by
  639.      * Intuition as long as there's a good correspondence between
  640.      * the image and the specified Gadgets
  641.      }
  642.  
  643.         ImageBMap       : BitMapPtr;    { points to the BitMap of PREDRAWN imagery }
  644.         RWindow         : Address;      { added.  points back to Window }
  645.         ReqPad2         : Array [0..35] of Byte;
  646.     end;
  647.     RequesterPtr = ^Requester;
  648.  
  649.  
  650. Const
  651.  
  652. { FLAGS SET BY THE APPLIPROG }
  653.     POINTREL            = $0001;    { if POINTREL set, TopLeft is relative to pointer}
  654.     PREDRAWN            = $0002;    { if ReqBMap points to predrawn Requester imagery }
  655.     NOISYREQ            = $0004;    { if you don't want requester to filter input          }
  656.  
  657.     SIMPLEREQ           = $0010;
  658.         { to use SIMPLEREFRESH layer (recommended)     }
  659.  
  660.     { New for V36          }
  661.     USEREQIMAGE         = $0020;
  662.          {  render linked list ReqImage after BackFill
  663.          * but before gadgets and text
  664.          }
  665.     NOREQBACKFILL       = $0040;
  666.         { don't bother filling requester with Requester.BackFill pen   }
  667.  
  668.  
  669. { FLAGS SET BY INTUITION }
  670.     REQOFFWINDOW        = $1000;        { part of one of the Gadgets was offwindow }
  671.     REQACTIVE           = $2000;        { this requester is active }
  672.     SYSREQUEST          = $4000;        { this requester caused by system }
  673.     DEFERREFRESH        = $8000;        { this Requester stops a Refresh broadcast }
  674.  
  675.  
  676.  
  677.  
  678. { ======================================================================== }
  679. { === Image ============================================================== }
  680. { ======================================================================== }
  681. { This is a brief image structure for very simple transfers of
  682.  * image data to a RastPort
  683.  }
  684.  
  685. Type
  686.  
  687.     Image = record
  688.         LeftEdge        : Short;        { starting offset relative to some origin }
  689.         TopEdge         : Short;        { starting offsets relative to some origin }
  690.         Width           : Short;        { pixel size (though data is word-aligned) }
  691.         Height,
  692.         Depth           : Short;        { pixel sizes }
  693.         ImageData       : Address;      { pointer to the actual word-aligned bits }
  694.  
  695.     { the PlanePick and PlaneOnOff variables work much the same way as the
  696.      * equivalent GELS Bob variables.  It's a space-saving
  697.      * mechanism for image data.  Rather than defining the image data
  698.      * for every plane of the RastPort, you need define data only
  699.      * for the planes that are not entirely zero or one.  As you
  700.      * define your Imagery, you will often find that most of the planes
  701.      * ARE just as color selectors.  For instance, if you're designing
  702.      * a two-color Gadget to use colors two and three, and the Gadget
  703.      * will reside in a five-plane display, bit plane zero of your
  704.      * imagery would be all ones, bit plane one would have data that
  705.      * describes the imagery, and bit planes two through four would be
  706.      * all zeroes.  Using these flags allows you to avoid wasting all
  707.      * that memory in this way:  first, you specify which planes you
  708.      * want your data to appear in using the PlanePick variable.  For
  709.      * each bit set in the variable, the next "plane" of your image
  710.      * data is blitted to the display.  For each bit clear in this
  711.      * variable, the corresponding bit in PlaneOnOff is examined.
  712.      * If that bit is clear, a "plane" of zeroes will be used.
  713.      * If the bit is set, ones will go out instead.  So, for our example:
  714.      *   Gadget.PlanePick = $02;
  715.      *   Gadget.PlaneOnOff = $01;
  716.      * Note that this also allows for generic Gadgets, like the
  717.      * System Gadgets, which will work in any number of bit planes.
  718.      * Note also that if you want an Image that is only a filled
  719.      * rectangle, you can get this by setting PlanePick to zero
  720.      * (pick no planes of data) and set PlaneOnOff to describe the pen
  721.      * color of the rectangle.
  722.      }
  723.  
  724.         PlanePick,
  725.         PlaneOnOff      : Byte;
  726.  
  727.     { if the NextImage variable is not NULL, Intuition presumes that
  728.      * it points to another Image structure with another Image to be
  729.      * rendered
  730.      }
  731.  
  732.         NextImage       : ^Image;
  733.     end;
  734.     ImagePtr = ^Image;
  735.  
  736.  
  737. { New for V39, Intuition supports the IESUBCLASS_NEWTABLET subclass
  738.  * of the IECLASS_NEWPOINTERPOS event.  The ie_EventAddress of such
  739.  * an event points to a TabletData structure (see below).
  740.  *
  741.  * The TabletData structure contains certain elements including a taglist.
  742.  * The taglist can be used for special tablet parameters.  A tablet driver
  743.  * should include only those tag-items the tablet supports.  An application
  744.  * can listen for any tag-items that interest it.  Note: an application
  745.  * must set the WA_TabletMessages attribute to TRUE to receive this
  746.  * extended information in its IntuiMessages.
  747.  *
  748.  * The definitions given here MUST be followed.  Pay careful attention
  749.  * to normalization and the interpretation of signs.
  750.  *
  751.  * TABLETA_TabletZ:  the current value of the tablet in the Z direction.
  752.  * This unsigned value should typically be in the natural units of the
  753.  * tablet.  You should also provide TABLETA_RangeZ.
  754.  *
  755.  * TABLETA_RangeZ:  the maximum value of the tablet in the Z direction.
  756.  * Normally specified along with TABLETA_TabletZ, this allows the
  757.  * application to scale the actual Z value across its range.
  758.  *
  759.  * TABLETA_AngleX:  the angle of rotation or tilt about the X-axis.  This
  760.  * number should be normalized to fill a signed long integer.  Positive
  761.  * values imply a clockwise rotation about the X-axis when viewing
  762.  * from +X towards the origin.
  763.  *
  764.  * TABLETA_AngleY:  the angle of rotation or tilt about the Y-axis.  This
  765.  * number should be normalized to fill a signed long integer.  Positive
  766.  * values imply a clockwise rotation about the Y-axis when viewing
  767.  * from +Y towards the origin.
  768.  *
  769.  * TABLETA_AngleZ:  the angle of rotation or tilt about the Z axis.  This
  770.  * number should be normalized to fill a signed long integer.  Positive
  771.  * values imply a clockwise rotation about the Z-axis when viewing
  772.  * from +Z towards the origin.
  773.  *
  774.  *      Note: a stylus that supports tilt should use the TABLETA_AngleX
  775.  *      and TABLETA_AngleY attributes.  Tilting the stylus so the tip
  776.  *      points towards increasing or decreasing X is actually a rotation
  777.  *      around the Y-axis.  Thus, if the stylus tip points towards
  778.  *      positive X, then that tilt is represented as a negative
  779.  *      TABLETA_AngleY.  Likewise, if the stylus tip points towards
  780.  *      positive Y, that tilt is represented by positive TABLETA_AngleX.
  781.  *
  782.  * TABLETA_Pressure:  the pressure reading of the stylus.  The pressure
  783.  * should be normalized to fill a signed long integer.  Typical devices
  784.  * won't generate negative pressure, but the possibility is not precluded.
  785.  * The pressure threshold which is considered to cause a button-click is
  786.  * expected to be set in a Preferences program supplied by the tablet
  787.  * vendor.  The tablet driver would send IECODE_LBUTTON-type events as
  788.  * the pressure crossed that threshold.
  789.  *
  790.  * TABLETA_ButtonBits:  ti_Data is a long integer whose bits are to
  791.  * be interpreted at the state of the first 32 buttons of the tablet.
  792.  *
  793.  * TABLETA_InProximity:  ti_Data is a boolean.  For tablets that support
  794.  * proximity, they should send the (TABLETA_InProximity,FALSE) tag item
  795.  * when the stylus is out of proximity.  One possible use we can forsee
  796.  * is a mouse-blanking commodity which keys off this to blank the
  797.  * mouse.  When this tag is absent, the stylus is assumed to be
  798.  * in proximity.
  799.  *
  800.  * TABLETA_ResolutionX:  ti_Data is an unsigned long integer which
  801.  * is the x-axis resolution in dots per inch.
  802.  *
  803.  * TABLETA_ResolutionY:  ti_Data is an unsigned long integer which
  804.  * is the y-axis resolution in dots per inch.
  805.  }
  806.  
  807. const
  808.  TABLETA_Dummy          = (TAG_USER + $3A000)  ;
  809.  TABLETA_TabletZ        = (TABLETA_Dummy + $01);
  810.  TABLETA_RangeZ         = (TABLETA_Dummy + $02);
  811.  TABLETA_AngleX         = (TABLETA_Dummy + $03);
  812.  TABLETA_AngleY         = (TABLETA_Dummy + $04);
  813.  TABLETA_AngleZ         = (TABLETA_Dummy + $05);
  814.  TABLETA_Pressure       = (TABLETA_Dummy + $06);
  815.  TABLETA_ButtonBits     = (TABLETA_Dummy + $07);
  816.  TABLETA_InProximity    = (TABLETA_Dummy + $08);
  817.  TABLETA_ResolutionX    = (TABLETA_Dummy + $09);
  818.  TABLETA_ResolutionY    = (TABLETA_Dummy + $0A);
  819.  
  820. { If your window sets WA_TabletMessages to TRUE, then it will receive
  821.  * extended IntuiMessages (struct ExtIntuiMessage) whose eim_TabletData
  822.  * field points at a TabletData structure.  This structure contains
  823.  * additional information about the input event.
  824.  }
  825.  
  826. Type
  827.  TabletData = Record
  828.     { Sub-pixel position of tablet, in screen coordinates,
  829.      * scaled to fill a UWORD fraction:
  830.      }
  831.     td_XFraction, td_YFraction  : WORD;
  832.  
  833.     { Current tablet coordinates along each axis: }
  834.     td_TabletX, td_TabletY      : Integer;
  835.  
  836.     { Tablet range along each axis.  For example, if td_TabletX
  837.      * can take values 0-999, td_RangeX should be 1000.
  838.      }
  839.     td_RangeX, td_RangeY        : Integer;
  840.  
  841.     { Pointer to tag-list of additional tablet attributes.
  842.      * See <intuition/intuition.h> for the tag values.
  843.      }
  844.     td_TagList                  : Address;
  845.  end;
  846.  TabletDataPtr = ^TabletData;
  847.  
  848. { If a tablet driver supplies a hook for ient_CallBack, it will be
  849.  * invoked in the standard hook manner.  A0 will point to the Hook
  850.  * itself, A2 will point to the InputEvent that was sent, and
  851.  * A1 will point to a TabletHookData structure.  The InputEvent's
  852.  * ie_EventAddress field points at the IENewTablet structure that
  853.  * the driver supplied.
  854.  *
  855.  * Based on the thd_Screen, thd_Width, and thd_Height fields, the driver
  856.  * should scale the ient_TabletX and ient_TabletY fields and store the
  857.  * result in ient_ScaledX, ient_ScaledY, ient_ScaledXFraction, and
  858.  * ient_ScaledYFraction.
  859.  *
  860.  * The tablet hook must currently return NULL.  This is the only
  861.  * acceptable return-value under V39.
  862.  }
  863.  
  864.  TabletHookData = Record
  865.     { Pointer to the active screen:
  866.      * Note: if there are no open screens, thd_Screen will be NULL.
  867.      * thd_Width and thd_Height will then describe an NTSC 64$400
  868.      * screen.  Please scale accordingly.
  869.      }
  870.     thd_Screen      : ScreenPtr;
  871.  
  872.     { The width and height (measured in pixels of the active screen)
  873.      * that your are to scale to:
  874.      }
  875.     thd_Width,
  876.     thd_Height      : Integer;
  877.  
  878.     { Non-zero if the screen or something about the screen
  879.      * changed since the last time you were invoked:
  880.      }
  881.     thd_ScreenChanged   : Integer;
  882.  end;
  883.  TabletHookDataPtr = ^TabletHookData;
  884.  
  885.  
  886. { ======================================================================== }
  887. { === IntuiMessage ======================================================= }
  888. { ======================================================================== }
  889.  
  890. Type
  891.  
  892.     IntuiMessage = record
  893.         ExecMessage     : Message;
  894.  
  895.     { the Class bits correspond directly with the IDCMP Flags, except for the
  896.      * special bit LONELYMESSAGE (defined below)
  897.      }
  898.  
  899.         Class           : Integer;
  900.  
  901.     { the Code field is for special values like MENU number }
  902.  
  903.         Code            : Short;
  904.  
  905.     { the Qualifier field is a copy of the current InputEvent's Qualifier }
  906.  
  907.         Qualifier       : Short;
  908.  
  909.     { IAddress contains particular addresses for Intuition functions, like
  910.      * the pointer to the Gadget or the Screen
  911.      }
  912.  
  913.         IAddress        : Address;
  914.  
  915.     { when getting mouse movement reports, any event you get will have the
  916.      * the mouse coordinates in these variables.  the coordinates are relative
  917.      * to the upper-left corner of your Window (GIMMEZEROZERO notwithstanding)
  918.      }
  919.  
  920.         MouseX,
  921.         MouseY          : Short;
  922.  
  923.     { the time values are copies of the current system clock time.  Micros
  924.      * are in units of microseconds, Seconds in seconds.
  925.      }
  926.  
  927.         Seconds,
  928.         Micros          : Integer;
  929.  
  930.     { the IDCMPWindow variable will always have the address of the Window of
  931.      * this IDCMP
  932.      }
  933.  
  934.         IDCMPWindow     : Address;
  935.  
  936.     { system-use variable }
  937.  
  938.         SpecialLink     : ^IntuiMessage;
  939.     end;
  940.     IntuiMessagePtr = ^IntuiMessage;
  941.  
  942. { New for V39:
  943.  * All IntuiMessages are now slightly extended.  The ExtIntuiMessage
  944.  * structure has an additional field for tablet data, which is usually
  945.  * NULL.  If a tablet driver which is sending IESUBCLASS_NEWTABLET
  946.  * events is installed in the system, windows with the WA_TabletMessages
  947.  * property set will find that eim_TabletData points to the TabletData
  948.  * structure.  Applications must first check that this field is non-NULL;
  949.  * it will be NULL for certain kinds of message, including mouse activity
  950.  * generated from other than the tablet (i.e. the keyboard equivalents
  951.  * or the mouse itself).
  952.  *
  953.  * NEVER EVER examine any extended fields when running under pre-V39!
  954.  *
  955.  * NOTE: This structure is subject to grow in the future.  Making
  956.  * assumptions about its size is A BAD IDEA.
  957.  }
  958.  
  959.  ExtIntuiMessage = Record
  960.     eim_IntuiMessage  : IntuiMessage;
  961.     eim_TabletData    : TabletDataPtr;
  962.  end;
  963.  ExtIntuiMessagePtr = ^ExtIntuiMessage;
  964.  
  965.  
  966. CONST
  967.  
  968. { --- IDCMP Classes ------------------------------------------------------ }
  969. { Please refer to the Autodoc for OpenWindow() and to the Rom Kernel
  970.  * Manual for full details on the IDCMP classes.
  971.  }
  972.  IDCMP_SIZEVERIFY      =  $00000001;
  973.  IDCMP_NEWSIZE         =  $00000002;
  974.  IDCMP_REFRESHWINDOW   =  $00000004;
  975.  IDCMP_MOUSEBUTTONS    =  $00000008;
  976.  IDCMP_MOUSEMOVE       =  $00000010;
  977.  IDCMP_GADGETDOWN      =  $00000020;
  978.  IDCMP_GADGETUP        =  $00000040;
  979.  IDCMP_REQSET          =  $00000080;
  980.  IDCMP_MENUPICK        =  $00000100;
  981.  IDCMP_CLOSEWINDOW     =  $00000200;
  982.  IDCMP_RAWKEY          =  $00000400;
  983.  IDCMP_REQVERIFY       =  $00000800;
  984.  IDCMP_REQCLEAR        =  $00001000;
  985.  IDCMP_MENUVERIFY      =  $00002000;
  986.  IDCMP_NEWPREFS        =  $00004000;
  987.  IDCMP_DISKINSERTED    =  $00008000;
  988.  IDCMP_DISKREMOVED     =  $00010000;
  989.  IDCMP_WBENCHMESSAGE   =  $00020000;  {  System use only         }
  990.  IDCMP_ACTIVEWINDOW    =  $00040000;
  991.  IDCMP_INACTIVEWINDOW  =  $00080000;
  992.  IDCMP_DELTAMOVE       =  $00100000;
  993.  IDCMP_VANILLAKEY      =  $00200000;
  994.  IDCMP_INTUITICKS      =  $00400000;
  995. {  for notifications from "boopsi" gadgets               }
  996.  IDCMP_IDCMPUPDATE     =  $00800000;  { new for V36      }
  997. { for getting help key report during menu session        }
  998.  IDCMP_MENUHELP        =  $01000000;  { new for V36      }
  999. { for notification of any move/size/zoom/change window   }
  1000.  IDCMP_CHANGEWINDOW    =  $02000000;  { new for V36      }
  1001.  IDCMP_GADGETHELP      =  $04000000;  { new for V39      }
  1002.  
  1003. { NOTEZ-BIEN:                          $80000000 is reserved for internal use   }
  1004.  
  1005. { the IDCMP Flags do not use this special bit, which is cleared when
  1006.  * Intuition sends its special message to the Task, and set when Intuition
  1007.  * gets its Message back from the Task.  Therefore, I can check here to
  1008.  * find out fast whether or not this Message is available for me to send
  1009.  }
  1010.  IDCMP_LONELYMESSAGE   =  $80000000;
  1011.  
  1012.  
  1013. { --- IDCMP Codes -------------------------------------------------------- }
  1014. { This group of codes is for the IDCMP_CHANGEWINDOW message }
  1015.  CWCODE_MOVESIZE = $0000;  { Window was moved and/or sized }
  1016.  CWCODE_DEPTH    = $0001;  { Window was depth-arranged (new for V39) }
  1017.  
  1018. { This group of codes is for the IDCMP_MENUVERIFY function }
  1019.  MENUHOT       =  $0001;  { IntuiWants verification OR MENUCANCEL    }
  1020.  MENUCANCEL    =  $0002;  { HOT Reply of this cancels Menu operation }
  1021.  MENUWAITING   =  $0003;  { Intuition simply wants a ReplyMsg() ASAP }
  1022.  
  1023. { These are internal tokens to represent state of verification attempts
  1024.  * shown here as a clue.
  1025.  }
  1026.  OKOK          =  MENUHOT; { guy didn't care                      }
  1027.  OKABORT       =  $0004;  { window rendered question moot        }
  1028.  OKCANCEL      =  MENUCANCEL; { window sent cancel reply          }
  1029.  
  1030. { This group of codes is for the IDCMP_WBENCHMESSAGE messages }
  1031.  WBENCHOPEN    =  $0001;
  1032.  WBENCHCLOSE   =  $0002;
  1033.  
  1034.  
  1035. { A data structure common in V36 Intuition processing  }
  1036. Type
  1037.    IBox = Record
  1038.     Left,
  1039.     Top,
  1040.     Width,
  1041.     Height : Short;
  1042.    END;
  1043.    IBoxPtr = ^IBox;
  1044.  
  1045.  
  1046. { ======================================================================== }
  1047. { === Window ============================================================= }
  1048. { ======================================================================== }
  1049.  
  1050. Type
  1051.  
  1052.     Window = record
  1053.         NextWindow      : ^Window;      { for the linked list in a screen }
  1054.  
  1055.         LeftEdge,
  1056.         TopEdge         : Short;        { screen dimensions of window }
  1057.         Width,
  1058.         Height          : Short;        { screen dimensions of window }
  1059.  
  1060.         MouseY,
  1061.         MouseX          : Short;        { relative to upper-left of window }
  1062.  
  1063.         MinWidth,
  1064.         MinHeight       : Short;        { minimum sizes }
  1065.         MaxWidth,
  1066.         MaxHeight       : Short;        { maximum sizes }
  1067.  
  1068.         Flags           : Integer;      { see below for defines }
  1069.  
  1070.         MenuStrip       : MenuPtr;      { the strip of Menu headers }
  1071.  
  1072.         Title           : String;       { the title text for this window }
  1073.  
  1074.         FirstRequest    : RequesterPtr; { all active Requesters }
  1075.  
  1076.         DMRequest       : RequesterPtr; { double-click Requester }
  1077.  
  1078.         ReqCount        : Short;        { count of reqs blocking Window }
  1079.  
  1080.         WScreen         : Address;      { this Window's Screen }
  1081.         RPort           : RastPortPtr;  { this Window's very own RastPort }
  1082.  
  1083.     { the border variables describe the window border.   If you specify
  1084.      * GIMMEZEROZERO when you open the window, then the upper-left of the
  1085.      * ClipRect for this window will be upper-left of the BitMap (with correct
  1086.      * offsets when in SuperBitMap mode; you MUST select GIMMEZEROZERO when
  1087.      * using SuperBitMap).  If you don't specify ZeroZero, then you save
  1088.      * memory (no allocation of RastPort, Layer, ClipRect and associated
  1089.      * Bitmaps), but you also must offset all your writes by BorderTop,
  1090.      * BorderLeft and do your own mini-clipping to prevent writing over the
  1091.      * system gadgets
  1092.      }
  1093.  
  1094.         BorderLeft,
  1095.         BorderTop,
  1096.         BorderRight,
  1097.         BorderBottom    : Byte;
  1098.         BorderRPort     : RastPortPtr;
  1099.  
  1100.  
  1101.     { You supply a linked-list of Gadgets for your Window.
  1102.      * This list DOES NOT include system gadgets.  You get the standard
  1103.      * window system gadgets by setting flag-bits in the variable Flags (see
  1104.      * the bit definitions below)
  1105.      }
  1106.  
  1107.         FirstGadget     : GadgetPtr;
  1108.  
  1109.     { these are for opening/closing the windows }
  1110.  
  1111.         Parent,
  1112.         Descendant      : ^Window;
  1113.  
  1114.     { sprite data information for your own Pointer
  1115.      * set these AFTER you Open the Window by calling SetPointer()
  1116.      }
  1117.  
  1118.         Pointer         : Address;      { sprite data }
  1119.         PtrHeight       : Byte;         { sprite height (not including sprite padding) }
  1120.         PtrWidth        : Byte;         { sprite width (must be less than or equal to 16) }
  1121.         XOffset,
  1122.         YOffset         : Byte;         { sprite offsets }
  1123.  
  1124.     { the IDCMP Flags and User's and Intuition's Message Ports }
  1125.         IDCMPFlags      : Integer;      { User-selected flags }
  1126.         UserPort,
  1127.         WindowPort      : MsgPortPtr;
  1128.         MessageKey      : IntuiMessagePtr;
  1129.  
  1130.         DetailPen,
  1131.         BlockPen        : Byte; { for bar/border/gadget rendering }
  1132.  
  1133.     { the CheckMark is a pointer to the imagery that will be used when
  1134.      * rendering MenuItems of this Window that want to be checkmarked
  1135.      * if this is equal to NULL, you'll get the default imagery
  1136.      }
  1137.  
  1138.         CheckMark       : ImagePtr;
  1139.  
  1140.         ScreenTitle     : String; { if non-null, Screen title when Window is active }
  1141.  
  1142.     { These variables have the mouse coordinates relative to the
  1143.      * inner-Window of GIMMEZEROZERO Windows.  This is compared with the
  1144.      * MouseX and MouseY variables, which contain the mouse coordinates
  1145.      * relative to the upper-left corner of the Window, GIMMEZEROZERO
  1146.      * notwithstanding
  1147.      }
  1148.  
  1149.         GZZMouseX       : Short;
  1150.         GZZMouseY       : Short;
  1151.  
  1152.     { these variables contain the width and height of the inner-Window of
  1153.      * GIMMEZEROZERO Windows
  1154.      }
  1155.  
  1156.         GZZWidth        : Short;
  1157.         GZZHeight       : Short;
  1158.  
  1159.         ExtData         : Address;
  1160.  
  1161.         UserData        : Address;      { general-purpose pointer to User data extension }
  1162.  
  1163.     {* jimm: NEW: 11/18/85: this pointer keeps a duplicate of what
  1164.      * Window.RPort->Layer is _supposed_ to be pointing at
  1165.      }
  1166.  
  1167.         WLayer          : LayerPtr;
  1168.  
  1169.     { jimm: NEW 1.2: need to keep track of the font that
  1170.      * OpenWindow opened, in case user SetFont's into RastPort
  1171.      }
  1172.  
  1173.         IFont           : TextFontPtr;
  1174.     {* (V36) another flag word (the Flags field is used up).
  1175.      * At present, all flag values are system private.
  1176.      * Until further notice, you may not change nor use this field.
  1177.      *}
  1178.         MoreFlags       : Integer;
  1179.  
  1180.     {**** Data beyond this point are Intuition Private.  DO NOT USE ****}
  1181.  
  1182.     end;
  1183.     WindowPtr = ^Window;
  1184.  
  1185. CONST
  1186. { --- Flags requested at OpenWindow() time by the application --------- }
  1187.  WFLG_SIZEGADGET   =  $00000001;  { include sizing system-gadget? }
  1188.  WFLG_DRAGBAR      =  $00000002;  { include dragging system-gadget? }
  1189.  WFLG_DEPTHGADGET  =  $00000004;  { include depth arrangement gadget? }
  1190.  WFLG_CLOSEGADGET  =  $00000008;  { include close-box system-gadget? }
  1191.  
  1192.  WFLG_SIZEBRIGHT   =  $00000010;  { size gadget uses right border }
  1193.  WFLG_SIZEBBOTTOM  =  $00000020;  { size gadget uses bottom border }
  1194.  
  1195. { --- refresh modes ------------------------------------------------------ }
  1196. { combinations of the WFLG_REFRESHBITS select the refresh type }
  1197.  WFLG_REFRESHBITS   = $000000C0;
  1198.  WFLG_SMART_REFRESH = $00000000;
  1199.  WFLG_SIMPLE_REFRESH= $00000040;
  1200.  WFLG_SUPER_BITMAP  = $00000080;
  1201.  WFLG_OTHER_REFRESH = $000000C0;
  1202.  
  1203.  WFLG_BACKDROP      = $00000100;  { this is a backdrop window }
  1204.  
  1205.  WFLG_REPORTMOUSE   = $00000200;  { to hear about every mouse move }
  1206.  
  1207.  WFLG_GIMMEZEROZERO = $00000400;  { a GimmeZeroZero window       }
  1208.  
  1209.  WFLG_BORDERLESS    = $00000800;  { to get a Window sans border }
  1210.  
  1211.  WFLG_ACTIVATE      = $00001000;  { when Window opens, it's Active }
  1212.  
  1213.  
  1214. { --- Other User Flags --------------------------------------------------- }
  1215.  WFLG_RMBTRAP       = $00010000;  { Catch RMB events for your own }
  1216.  WFLG_NOCAREREFRESH = $00020000;  { not to be bothered with REFRESH }
  1217.  
  1218. { - V36 new Flags which the programmer may specify in NewWindow.Flags  }
  1219.  WFLG_NW_EXTENDED   = $00040000;  { extension data provided      }
  1220.                                         { see struct ExtNewWindow      }
  1221.  
  1222. { - V39 new Flags which the programmer may specify in NewWindow.Flags  }
  1223.  WFLG_NEWLOOKMENUS  = $00200000;  { window has NewLook menus     }
  1224.  
  1225. { These flags are set only by Intuition.  YOU MAY NOT SET THEM YOURSELF! }
  1226.  WFLG_WINDOWACTIVE  = $00002000;  { this window is the active one }
  1227.  WFLG_INREQUEST     = $00004000;  { this window is in request mode }
  1228.  WFLG_MENUSTATE     = $00008000;  { Window is active with Menus on }
  1229.  WFLG_WINDOWREFRESH = $01000000;  { Window is currently refreshing }
  1230.  WFLG_WBENCHWINDOW  = $02000000;  { WorkBench tool ONLY Window }
  1231.  WFLG_WINDOWTICKED  = $04000000;  { only one timer tick at a time }
  1232.  
  1233. { --- V36 Flags to be set only by Intuition -------------------------  }
  1234.  WFLG_VISITOR       = $08000000;  { visitor window               }
  1235.  WFLG_ZOOMED        = $10000000;  { identifies "zoom state"      }
  1236.  WFLG_HASZOOM       = $20000000;  { windowhas a zoom gadget      }
  1237.  
  1238. { --- Other Window Values ---------------------------------------------- }
  1239.  DEFAULTMOUSEQUEUE  =     (5);     { no more mouse messages       }
  1240.  
  1241. { --- see struct IntuiMessage for the IDCMP Flag definitions ------------- }
  1242.  
  1243.  
  1244. { ======================================================================== }
  1245. { === NewWindow ========================================================== }
  1246. { ======================================================================== }
  1247.  
  1248. Type
  1249.  
  1250.     NewWindow = record
  1251.         LeftEdge,
  1252.         TopEdge         : Short;        { screen dimensions of window }
  1253.         Width,
  1254.         Height          : Short;        { screen dimensions of window }
  1255.  
  1256.         DetailPen,
  1257.         BlockPen        : Byte;         { for bar/border/gadget rendering }
  1258.  
  1259.         IDCMPFlags      : Integer;      { User-selected IDCMP flags }
  1260.  
  1261.         Flags           : Integer;      { see Window struct for defines }
  1262.  
  1263.     { You supply a linked-list of Gadgets for your Window.
  1264.      *  This list DOES NOT include system Gadgets.  You get the standard
  1265.      *  system Window Gadgets by setting flag-bits in the variable Flags (see
  1266.      *  the bit definitions under the Window structure definition)
  1267.      }
  1268.  
  1269.         FirstGadget     : GadgetPtr;
  1270.  
  1271.     { the CheckMark is a pointer to the imagery that will be used when
  1272.      * rendering MenuItems of this Window that want to be checkmarked
  1273.      * if this is equal to NULL, you'll get the default imagery
  1274.      }
  1275.  
  1276.         CheckMark       : ImagePtr;
  1277.  
  1278.         Title           : String;  { the title text for this window }
  1279.  
  1280.     { the Screen pointer is used only if you've defined a CUSTOMSCREEN and
  1281.      * want this Window to open in it.  If so, you pass the address of the
  1282.      * Custom Screen structure in this variable.  Otherwise, this variable
  1283.      * is ignored and doesn't have to be initialized.
  1284.      }
  1285.  
  1286.         Screen          : Address;
  1287.  
  1288.     { SUPER_BITMAP Window?  If so, put the address of your BitMap structure
  1289.      * in this variable.  If not, this variable is ignored and doesn't have
  1290.      * to be initialized
  1291.      }
  1292.  
  1293.         BitMap          : BitMapPtr;
  1294.  
  1295.     { the values describe the minimum and maximum sizes of your Windows.
  1296.      * these matter only if you've chosen the WINDOWSIZING Gadget option,
  1297.      * which means that you want to let the User to change the size of
  1298.      * this Window.  You describe the minimum and maximum sizes that the
  1299.      * Window can grow by setting these variables.  You can initialize
  1300.      * any one these to zero, which will mean that you want to duplicate
  1301.      * the setting for that dimension (if MinWidth == 0, MinWidth will be
  1302.      * set to the opening Width of the Window).
  1303.      * You can change these settings later using SetWindowLimits().
  1304.      * If you haven't asked for a SIZING Gadget, you don't have to
  1305.      * initialize any of these variables.
  1306.      }
  1307.  
  1308.         MinWidth,
  1309.         MinHeight       : Short;        { minimums }
  1310.         MaxWidth,
  1311.         MaxHeight       : Short;        { maximums }
  1312.  
  1313.     { the type variable describes the Screen in which you want this Window to
  1314.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1315.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1316.      * type definitions under the Screen structure
  1317.      }
  1318.  
  1319.         WType           : Short;        { is "Type" in C includes }
  1320.     end;
  1321.     NewWindowPtr = ^NewWindow;
  1322.  
  1323.  
  1324. { The following structure is the future NewWindow.  Compatibility
  1325.  * issues require that the size of NewWindow not change.
  1326.  * Data in the common part (NewWindow) indicates the the extension
  1327.  * fields are being used.
  1328.  * NOTE WELL: This structure may be subject to future extension.
  1329.  * Writing code depending on its size is not allowed.
  1330.  }
  1331.    ExtNewWindow = Record
  1332.     LeftEdge, TopEdge : Short;
  1333.     Width, Height : Short;
  1334.  
  1335.     DetailPen, BlockPen : Byte;
  1336.     IDCMPFlags    : Integer;
  1337.     Flags         : Integer;
  1338.     FirstGadget   : GadgetPtr;
  1339.  
  1340.     CheckMark     : ImagePtr;
  1341.  
  1342.     Title         : String;
  1343.     WScreen       : Address;
  1344.     WBitMap       : BitMapPtr;
  1345.  
  1346.     MinWidth, MinHeight : Short;
  1347.     MaxWidth, MaxHeight : Short;
  1348.  
  1349.     { the type variable describes the Screen in which you want this Window to
  1350.      * open.  The type value can either be CUSTOMSCREEN or one of the
  1351.      * system standard Screen Types such as WBENCHSCREEN.  See the
  1352.      * type definitions under the Screen structure.
  1353.      * A new possible value for this field is PUBLICSCREEN, which
  1354.      * defines the window as a 'visitor' window.  See below for
  1355.      * additional information provided.
  1356.      }
  1357.     WType  : Short;
  1358.  
  1359.     { ------------------------------------------------------- *
  1360.      * extensions for V36
  1361.      * if the NewWindow Flag value WFLG_NW_EXTENDED is set, then
  1362.      * this field is assumed to point to an array ( or chain of arrays)
  1363.      * of TagItem structures.  See also ExtNewScreen for another
  1364.      * use of TagItems to pass optional data.
  1365.      *
  1366.      * see below for tag values and the corresponding data.
  1367.      }
  1368.     Extension : TagItemPtr;
  1369.   END;
  1370.   ExtNewWindowPtr = ^ExtNewWindow;
  1371.  
  1372. {
  1373.  * The TagItem ID's (ti_Tag values) for OpenWindowTagList() follow.
  1374.  * They are values in a TagItem array passed as extension/replacement
  1375.  * values for the data in NewWindow.  OpenWindowTagList() can actually
  1376.  * work well with a NULL NewWindow pointer.
  1377.  }
  1378. CONST
  1379.  WA_Dummy     =   (TAG_USER + 99); { $80000063   }
  1380.  
  1381. { these tags simply override NewWindow parameters }
  1382.  WA_Left               =  (WA_Dummy + $01);
  1383.  WA_Top                =  (WA_Dummy + $02);
  1384.  WA_Width              =  (WA_Dummy + $03);
  1385.  WA_Height             =  (WA_Dummy + $04);
  1386.  WA_DetailPen          =  (WA_Dummy + $05);
  1387.  WA_BlockPen           =  (WA_Dummy + $06);
  1388.  WA_IDCMP              =  (WA_Dummy + $07);
  1389.                         { "bulk" initialization of NewWindow.Flags }
  1390.  WA_Flags              =  (WA_Dummy + $08);
  1391.  WA_Gadgets            =  (WA_Dummy + $09);
  1392.  WA_Checkmark          =  (WA_Dummy + $0A);
  1393.  WA_Title              =  (WA_Dummy + $0B);
  1394.                         { means you don't have to call SetWindowTitles
  1395.                          * after you open your window
  1396.                          }
  1397.  WA_ScreenTitle        =  (WA_Dummy + $0C);
  1398.  WA_CustomScreen       =  (WA_Dummy + $0D);
  1399.  WA_SuperBitMap        =  (WA_Dummy + $0E);
  1400.                         { also implies WFLG_SUPER_BITMAP property      }
  1401.  WA_MinWidth           =  (WA_Dummy + $0F);
  1402.  WA_MinHeight          =  (WA_Dummy + $10);
  1403.  WA_MaxWidth           =  (WA_Dummy + $11);
  1404.  WA_MaxHeight          =  (WA_Dummy + $12);
  1405.  
  1406. { The following are specifications for new features    }
  1407.  
  1408.  WA_InnerWidth         =  (WA_Dummy + $13);
  1409.  WA_InnerHeight        =  (WA_Dummy + $14);
  1410.                         { You can specify the dimensions of the interior
  1411.                          * region of your window, independent of what
  1412.                          * the border widths will be.  You probably want
  1413.                          * to also specify WA_AutoAdjust to allow
  1414.                          * Intuition to move your window or even
  1415.                          * shrink it so that it is completely on screen.
  1416.                          }
  1417.  
  1418.  WA_PubScreenName      =  (WA_Dummy + $15);
  1419.                         { declares that you want the window to open as
  1420.                          * a visitor on the public screen whose name is
  1421.                          * pointed to by (UBYTE *) ti_Data
  1422.                          }
  1423.  WA_PubScreen          =  (WA_Dummy + $16);
  1424.                         { open as a visitor window on the public screen
  1425.                          * whose address is in (struct Screen *) ti_Data.
  1426.                          * To ensure that this screen remains open, you
  1427.                          * should either be the screen's owner, have a
  1428.                          * window open on the screen, or use LockPubScreen().
  1429.                          }
  1430.  WA_PubScreenFallBack  =  (WA_Dummy + $17);
  1431.                         { A Boolean, specifies whether a visitor window
  1432.                          * should "fall back" to the default public screen
  1433.                          * (or Workbench) if the named public screen isn't
  1434.                          * available
  1435.                          }
  1436.  WA_WindowName         =  (WA_Dummy + $18);
  1437.                         { not implemented      }
  1438.  WA_Colors             =  (WA_Dummy + $19);
  1439.                         { a ColorSpec array for colors to be set
  1440.                          * when this window is active.  This is not
  1441.                          * implemented, and may not be, since the default
  1442.                          * values to restore would be hard to track.
  1443.                          * We'd like to at least support per-window colors
  1444.                          * for the mouse pointer sprite.
  1445.                          }
  1446.  WA_Zoom       =  (WA_Dummy + $1A);
  1447.                         { ti_Data points to an array of four WORD's,
  1448.                          * the initial Left/Top/Width/Height values of
  1449.                          * the "alternate" zoom position/dimensions.
  1450.                          * It also specifies that you want a Zoom gadget
  1451.                          * for your window, whether or not you have a
  1452.                          * sizing gadget.
  1453.                          }
  1454.  WA_MouseQueue         =  (WA_Dummy + $1B);
  1455.                         { ti_Data contains initial value for the mouse
  1456.                          * message backlog limit for this window.
  1457.                          }
  1458.  WA_BackFill           =  (WA_Dummy + $1C);
  1459.                         { unimplemented at present: provides a "backfill
  1460.                          * hook" for your window's layer.
  1461.                          }
  1462.  WA_RptQueue           =  (WA_Dummy + $1D);
  1463.                         { initial value of repeat key backlog limit    }
  1464.  
  1465.     { These Boolean tag items are alternatives to the NewWindow.Flags
  1466.      * boolean flags with similar names.
  1467.      }
  1468.  WA_SizeGadget         =  (WA_Dummy + $1E);
  1469.  WA_DragBar            =  (WA_Dummy + $1F);
  1470.  WA_DepthGadget        =  (WA_Dummy + $20);
  1471.  WA_CloseGadget        =  (WA_Dummy + $21);
  1472.  WA_Backdrop           =  (WA_Dummy + $22);
  1473.  WA_ReportMouse        =  (WA_Dummy + $23);
  1474.  WA_NoCareRefresh      =  (WA_Dummy + $24);
  1475.  WA_Borderless         =  (WA_Dummy + $25);
  1476.  WA_Activate           =  (WA_Dummy + $26);
  1477.  WA_RMBTrap            =  (WA_Dummy + $27);
  1478.  WA_WBenchWindow       =  (WA_Dummy + $28);       { PRIVATE!! }
  1479.  WA_SimpleRefresh      =  (WA_Dummy + $29);
  1480.                         { only specify if TRUE }
  1481.  WA_SmartRefresh       =  (WA_Dummy + $2A);
  1482.                         { only specify if TRUE }
  1483.  WA_SizeBRight         =  (WA_Dummy + $2B);
  1484.  WA_SizeBBottom        =  (WA_Dummy + $2C);
  1485.  
  1486.     { New Boolean properties   }
  1487.  WA_AutoAdjust         =  (WA_Dummy + $2D);
  1488.                         { shift or squeeze the window's position and
  1489.                          * dimensions to fit it on screen.
  1490.                          }
  1491.  
  1492.  WA_GimmeZeroZero      =  (WA_Dummy + $2E);
  1493.                         { equiv. to NewWindow.Flags WFLG_GIMMEZEROZERO }
  1494.  
  1495. { New for V37: WA_MenuHelp (ignored by V36) }
  1496.  WA_MenuHelp           =  (WA_Dummy + $2F);
  1497.                         { Enables IDCMP_MENUHELP:  Pressing HELP during menus
  1498.                          * will return IDCMP_MENUHELP message.
  1499.                          }
  1500.  
  1501. { New for V39:  (ignored by V37 and earlier) }
  1502.  WA_NewLookMenus       =  (WA_Dummy + $30);
  1503.                         { Set to TRUE if you want NewLook menus }
  1504.  WA_AmigaKey           =  (WA_Dummy + $31);
  1505.                         { Pointer to image for Amiga-key equiv in menus }
  1506.  WA_NotifyDepth        =  (WA_Dummy + $32);
  1507.                         { Requests IDCMP_CHANGEWINDOW message when
  1508.                          * window is depth arranged
  1509.                          * (imsg->Code = CWCODE_DEPTH)
  1510.                          }
  1511.  
  1512. { WA_Dummy + $33 is obsolete }
  1513.  
  1514.  WA_Pointer            =  (WA_Dummy + $34);
  1515.                         { Allows you to specify a custom pointer
  1516.                          * for your window.  ti_Data points to a
  1517.                          * pointer object you obtained via
  1518.                          * "pointerclass". NULL signifies the
  1519.                          * default pointer.
  1520.                          * This tag may be passed to OpenWindowTags()
  1521.                          * or SetWindowPointer().
  1522.                          }
  1523.  
  1524.  WA_BusyPointer        =  (WA_Dummy + $35);
  1525.                         { ti_Data is boolean.  Set to TRUE to
  1526.                          * request the standard busy pointer.
  1527.                          * This tag may be passed to OpenWindowTags()
  1528.                          * or SetWindowPointer().
  1529.                          }
  1530.  
  1531.  WA_PointerDelay       =  (WA_Dummy + $36);
  1532.                         { ti_Data is boolean.  Set to TRUE to
  1533.                          * request that the changing of the
  1534.                          * pointer be slightly delayed.  The change
  1535.                          * will be called off if you call NewSetPointer()
  1536.                          * before the delay expires.  This allows
  1537.                          * you to post a busy-pointer even if you think
  1538.                          * the busy-time may be very short, without
  1539.                          * fear of a flashing pointer.
  1540.                          * This tag may be passed to OpenWindowTags()
  1541.                          * or SetWindowPointer().
  1542.                          }
  1543.  
  1544.  WA_TabletMessages     =  (WA_Dummy + $37);
  1545.                         { ti_Data is a boolean.  Set to TRUE to
  1546.                          * request that tablet information be included
  1547.                          * in IntuiMessages sent to your window.
  1548.                          * Requires that something (i.e. a tablet driver)
  1549.                          * feed IESUBCLASS_NEWTABLET InputEvents into
  1550.                          * the system.  For a pointer to the TabletData,
  1551.                          * examine the ExtIntuiMessage->eim_TabletData
  1552.                          * field.  It is UNSAFE to check this field
  1553.                          * when running on pre-V39 systems.  It's always
  1554.                          * safe to check this field under V39 and up,
  1555.                          * though it may be NULL.
  1556.                          }
  1557.  
  1558.  WA_HelpGroup          =  (WA_Dummy + $38);
  1559.                         { When the active window has gadget help enabled,
  1560.                          * other windows of the same HelpGroup number
  1561.                          * will also get GadgetHelp.  This allows GadgetHelp
  1562.                          * to work for multi-windowed applications.
  1563.                          * Use GetGroupID() to get an ID number.  Pass
  1564.                          * this number as ti_Data to all your windows.
  1565.                          * See also the HelpControl() function.
  1566.                          }
  1567.  
  1568.  WA_HelpGroupWindow    =  (WA_Dummy + $39);
  1569.                         { When the active window has gadget help enabled,
  1570.                          * other windows of the same HelpGroup will also get
  1571.                          * GadgetHelp.  This allows GadgetHelp to work
  1572.                          * for multi-windowed applications.  As an alternative
  1573.                          * to WA_HelpGroup, you can pass a pointer to any
  1574.                          * other window of the same group to join its help
  1575.                          * group.  Defaults to NULL, which has no effect.
  1576.                          * See also the HelpControl() function.
  1577.                          }
  1578.  
  1579.  
  1580. { HelpControl() flags:
  1581.  *
  1582.  * HC_GADGETHELP - Set this flag to enable Gadget-Help for one or more
  1583.  * windows.
  1584.  }
  1585.  
  1586.  HC_GADGETHELP  = 1;
  1587.  
  1588.  
  1589. { ======================================================================== }
  1590. { === Remember =========================================================== }
  1591. { ======================================================================== }
  1592. { this structure is used for remembering what memory has been allocated to
  1593.  * date by a given routine, so that a premature abort or systematic exit
  1594.  * can deallocate memory cleanly, easily, and completely
  1595.  }
  1596.  
  1597. Type
  1598.  
  1599.     Remember = record
  1600.         NextRemember    : ^Remember;
  1601.         RememberSize    : Integer;
  1602.         Memory          : Address;
  1603.     end;
  1604.     RememberPtr = ^Remember;
  1605.  
  1606.  
  1607. { === Color Spec ====================================================== }
  1608. { How to tell Intuition about RGB values for a color table entry. }
  1609.  
  1610.   ColorSpec = Record
  1611.     ColorIndex  : Short;     { -1 terminates an array of ColorSpec  }
  1612.     Red         : Short;     { only the _bottom_ 4 bits recognized }
  1613.     Green       : Short;     { only the _bottom_ 4 bits recognized }
  1614.     Blue        : Short;     { only the _bottom_ 4 bits recognized }
  1615.   END;
  1616.   ColorSpecPtr = ^ColorSpec;
  1617.  
  1618. { === Easy Requester Specification ======================================= }
  1619. { see also autodocs for EasyRequest and BuildEasyRequest       }
  1620. { NOTE: This structure may grow in size in the future          }
  1621.    EasyStruct = Record
  1622.     es_StructSize   : Integer;  { should be sizeof (struct EasyStruct )}
  1623.     es_Flags        : Integer;  { should be 0 for now                  }
  1624.     es_Title        : String;   { title of requester window            }
  1625.     es_TextFormat   : String;   { 'printf' style formatting string     }
  1626.     es_GadgetFormat : String;   { 'printf' style formatting string   }
  1627.    END;
  1628.    EasyStructPtr = ^EasyStruct;
  1629.  
  1630.  
  1631.  
  1632. { ======================================================================== }
  1633. { === Miscellaneous ====================================================== }
  1634. { ======================================================================== }
  1635. CONST
  1636. { = MENU STUFF =========================================================== }
  1637.     NOMENU      = $001F;
  1638.     NOITEM      = $003F;
  1639.     NOSUB       = $001F;
  1640.     MENUNULL    = -1;
  1641.  
  1642.  
  1643. { = =RJ='s peculiarities ================================================= }
  1644.  
  1645. { these defines are for the COMMSEQ and CHECKIT menu stuff.  If CHECKIT,
  1646.  * I'll use a generic Width (for all resolutions) for the CheckMark.
  1647.  * If COMMSEQ, likewise I'll use this generic stuff
  1648.  }
  1649.  
  1650.     CHECKWIDTH          = 19;
  1651.     COMMWIDTH           = 27;
  1652.     LOWCHECKWIDTH       = 13;
  1653.     LOWCOMMWIDTH        = 16;
  1654.  
  1655. { these are the AlertNumber defines.  if you are calling DisplayAlert()
  1656.  * the AlertNumber you supply must have the ALERT_TYPE bits set to one
  1657.  * of these patterns
  1658.  }
  1659.  
  1660.     ALERT_TYPE          = $80000000;
  1661.     RECOVERY_ALERT      = $00000000;    { the system can recover from this }
  1662.     DEADEND_ALERT       = $80000000;    { no recovery possible, this is it }
  1663.  
  1664.  
  1665. { When you're defining IntuiText for the Positive and Negative Gadgets
  1666.  * created by a call to AutoRequest(), these defines will get you
  1667.  * reasonable-looking text.  The only field without a define is the IText
  1668.  * field; you decide what text goes with the Gadget
  1669.  }
  1670.  
  1671.     AUTOFRONTPEN        = 0;
  1672.     AUTOBACKPEN         = 1;
  1673.     AUTODRAWMODE        = JAM2;
  1674.     AUTOLEFTEDGE        = 6;
  1675.     AUTOTOPEDGE         = 3;
  1676.     AUTOITEXTFONT       = Nil;
  1677.     AUTONEXTTEXT        = Nil;
  1678.  
  1679.  
  1680. { --- RAWMOUSE Codes and Qualifiers (Console OR IDCMP) ------------------- }
  1681.  
  1682.     SELECTUP            = IECODE_LBUTTON + IECODE_UP_PREFIX;
  1683.     SELECTDOWN          = IECODE_LBUTTON;
  1684.     MENUUP              = IECODE_RBUTTON + IECODE_UP_PREFIX;
  1685.     MENUDOWN            = IECODE_RBUTTON;
  1686.     ALTLEFT             = IEQUALIFIER_LALT;
  1687.     ALTRIGHT            = IEQUALIFIER_RALT;
  1688.     AMIGALEFT           = IEQUALIFIER_LCOMMAND;
  1689.     AMIGARIGHT          = IEQUALIFIER_RCOMMAND;
  1690.     AMIGAKEYS           = AMIGALEFT + AMIGARIGHT;
  1691.  
  1692.     CURSORUP            = $4C;
  1693.     CURSORLEFT          = $4F;
  1694.     CURSORRIGHT         = $4E;
  1695.     CURSORDOWN          = $4D;
  1696.     KEYCODE_Q           = $10;
  1697.     KEYCODE_X           = $32;
  1698.     KEYCODE_N           = $36;
  1699.     KEYCODE_M           = $37;
  1700.     KEYCODE_V           = $34;
  1701.     KEYCODE_B           = $35;
  1702.     KEYCODE_LESS        = $38;
  1703.     KEYCODE_GREATER     = $39;
  1704.  
  1705.  
  1706. {$I   "Include:Intuition/cgHooks.i"}
  1707. {$I   "Include:Intuition/Classes.i"}
  1708. {$I   "Include:Utility/Hooks.i"}
  1709.  
  1710. {$I   "Include:Intuition/Preferences.i"}
  1711. {$I   "Include:Intuition/Screens.i"}
  1712.  
  1713. { Include obsolete identifiers: }
  1714. {$I   "Include:Intuition/iobsolete.i"}
  1715.  
  1716. Function ActivateGadget(Gadget : GadgetPtr;
  1717.                         Window : WindowPtr;
  1718.                         Request : RequesterPtr) : Boolean;
  1719.     External;
  1720.  
  1721. Procedure ActivateWindow(Window : WindowPtr);
  1722.     External;
  1723.  
  1724. Function AddGadget(Window : WindowPtr;
  1725.                    Gadget : GadgetPtr;
  1726.                    Position : Short) : Short;
  1727.     External;
  1728.  
  1729.  
  1730. Function AddGList(Window : WindowPtr; Gadget : GadgetPtr;
  1731.                   Position : Short; Numgad : Short;
  1732.                   Requester : RequesterPtr) : Short;
  1733.     External;
  1734.  
  1735. Function AllocRemember(var RememberKey : RememberPtr;
  1736.                        Size, Flags : Integer) : Address;
  1737.     External;
  1738.  
  1739. Function AutoRequest(Window : WindowPtr;
  1740.                      BodyText, PositiveText, NegativeText : IntuiTextPtr;
  1741.                      PositiveFlags, NegativeFlags : Integer;
  1742.                      Width, Height : Short) : Boolean;
  1743.     External;
  1744.  
  1745. Procedure BeginRefresh(Window : WindowPtr);
  1746.     External;
  1747.  
  1748. Function BuildSysRequest(window : WindowPtr;
  1749.                         BodyText, PositiveText,NegativeText : IntuiTextPtr;
  1750.                         IDCMPFlags : Integer;
  1751.                         Width, Height : Short) : WindowPtr;
  1752.     External;
  1753.  
  1754. Function ClearDMRequest(window : WindowPtr) : Boolean;
  1755.     External;
  1756.  
  1757. Procedure ClearMenuStrip(window : WindowPtr);
  1758.     External;
  1759.  
  1760. Procedure ClearPointer(window : WindowPtr);
  1761.     External;
  1762.  
  1763. Procedure CloseScreen(screen : ScreenPtr);
  1764.     External;
  1765.  
  1766. Procedure CloseWindow(window : WindowPtr);
  1767.     External;
  1768.  
  1769. FUNCTION CloseWorkBench : Boolean;
  1770.     External;
  1771.  
  1772. Procedure CurrentTime(var Seconds, Micros : Integer);
  1773.     External;
  1774.  
  1775. Function DisplayAlert(AlertNumber : Integer;
  1776.                         Str : String; Height : Short) : Boolean;
  1777.     External;
  1778.  
  1779. Procedure DisplayBeep(screen : ScreenPtr);
  1780.     External;
  1781.  
  1782. Function DoubleClick(StartSecs, StartMicros,
  1783.                         CurrentSecs, CurrentMicros : Integer) : Boolean;
  1784.     External;
  1785.  
  1786. Procedure DrawBorder(rastport : RastPortPtr; Border : BorderPtr;
  1787.                         LeftOffset, TopOffset : Short);
  1788.     External;
  1789.  
  1790. Procedure DrawImage(rastport : RastPortPtr; Image : ImagePtr;
  1791.                         LeftOffset, TopOffset : Short);
  1792.     External;
  1793.  
  1794. Procedure EndRefresh(window : WindowPtr; Complete : Boolean);
  1795.     External;
  1796.  
  1797. Procedure EndRequest(requester : RequesterPtr; Window : WindowPtr);
  1798.     External;
  1799.  
  1800. Procedure FreeRemember(var RememberKey : RememberPtr; ReallyForget : Boolean);
  1801.     External;
  1802.  
  1803. Procedure FreeSysRequest(window : WindowPtr);
  1804.     External;
  1805.  
  1806. Function GetDefPrefs(PrefBuffer : PreferencesPtr;
  1807.                         Size : Short) : PreferencesPtr;
  1808.     External;
  1809.  
  1810. Function GetPrefs(PrefBuffer : PreferencesPtr; Size : Short) : PreferencesPtr;
  1811.     External;
  1812.  
  1813. Function GetScreenData(Buffer : Address; Size, SType : Short;
  1814.                         Screen : ScreenPtr) : Boolean;
  1815.     External;
  1816.  
  1817. Procedure InitRequester(requester : RequesterPtr);
  1818.     External;
  1819.  
  1820. Function IntuiTextLength(IText : IntuiTextPtr) : Integer;
  1821.     External;
  1822.  
  1823. Function ItemAddress(MenuStrip : MenuPtr; MenuNumber : Short) : MenuItemPtr;
  1824.     External;
  1825.  
  1826. Function ItemNum(MenuNumber : Short) : Short;
  1827.     External;
  1828.  
  1829. Function LockIBase(LockNumber : Integer) : Integer;
  1830.     External;
  1831.  
  1832. Procedure MakeScreen(Screen : ScreenPtr);
  1833.     External;
  1834.  
  1835. Function MenuNum(MenuNumber : Short) : Short;
  1836.     External;
  1837.  
  1838. Procedure ModifyIDCMP(window : WindowPtr; IDCMPFlags : Integer);
  1839.     External;
  1840.  
  1841. Procedure ModifyProp(gadget : GadgetPtr; window : WindowPtr;
  1842.                         requester : RequesterPtr; Flags : Short;
  1843.                         HorizPot, VertPot, HorizBody, VertBody : Short);
  1844.     External;
  1845.  
  1846. Procedure MoveScreen(screen : ScreenPtr; DeltaX, DeltaY : Short);
  1847.     External;
  1848.  
  1849. Procedure MoveWindow(window : WindowPtr; DeltaX, DeltaY : Short);
  1850.     External;
  1851.  
  1852. Procedure NewModifyProp(gadget : GadgetPtr; window : WindowPtr;
  1853.                         requester : RequesterPtr; Flags : Short;
  1854.                         HorizPot, VertPot, HorizBody, VertBody : Short;
  1855.                         NumGad : Integer);
  1856.     External;
  1857.  
  1858. Procedure OffGadget(gadget : GadgetPtr;
  1859.                         window : WindowPtr;
  1860.                         requester : RequesterPtr);
  1861.     External;
  1862.  
  1863. Procedure OffMenu(window : WindowPtr; MenuNumber : Short);
  1864.     External;
  1865.  
  1866. Procedure OnGadget(gadget : GadgetPtr;
  1867.                         window : WindowPtr;
  1868.                         requester : RequesterPtr);
  1869.     External;
  1870.  
  1871. Procedure OnMenu(window : WindowPtr; MenuNumber : Short);
  1872.     External;
  1873.  
  1874. Function OpenScreen(newscreen : NewScreenPtr) : ScreenPtr;
  1875.     External;
  1876.  
  1877. Function OpenWindow(newwindow : NewWindowPtr) : WindowPtr;
  1878.     External;
  1879.  
  1880. Function OpenWorkBench : ScreenPtr;
  1881.     External;
  1882.  
  1883. Procedure PrintIText(rastport : RastPortPtr; IText : IntuiTextPtr;
  1884.                         LeftOffset, TopOffset : Short);
  1885.     External;
  1886.  
  1887. Procedure RefreshGadgets(gadgets : GadgetPtr;
  1888.                         window : WindowPtr;
  1889.                         requester : RequesterPtr);
  1890.     External;
  1891.  
  1892. Procedure RefreshGList(gadgets : GadgetPtr; window : WindowPtr;
  1893.                         requester : RequesterPtr; NumGad : Short);
  1894.     External;
  1895.  
  1896. Procedure RefreshWindowFrame(window : WindowPtr);
  1897.     External;
  1898.  
  1899. Procedure RemakeDisplay;
  1900.     External;
  1901.  
  1902. Function RemoveGadget(window : WindowPtr; gadget : GadgetPtr) : Short;
  1903.     External;
  1904.  
  1905. Function RemoveGList(window : WindowPtr; gadget : GadgetPtr;
  1906.                         NumGad : Short) : Short;
  1907.     External;
  1908.  
  1909. Procedure ReportMouse(window : WindowPtr; DoIt : Boolean);
  1910.     External;
  1911.  
  1912. Function Request(requester : RequesterPtr; window : WindowPtr) : Boolean;
  1913.     External;
  1914.  
  1915. Procedure RethinkDisplay;
  1916.     External;
  1917.  
  1918. Procedure ScreenToBack(screen : ScreenPtr);
  1919.     External;
  1920.  
  1921. Procedure ScreenToFront(screen : ScreenPtr);
  1922.     External;
  1923.  
  1924. Procedure SetDMRequest(window : WindowPtr; DMRequester : RequesterPtr);
  1925.     External;
  1926.  
  1927. Function SetMenuStrip(window : WindowPtr; Menu : MenuPtr) : Boolean;
  1928.     External;
  1929.  
  1930. Procedure SetPointer(window : WindowPtr; pointer : Address;
  1931.                         Height, Width, XOffset, YOffset : Short);
  1932.     External;
  1933.  
  1934. Function SetPrefs(PrefBuffer : PreferencesPtr; Size : Integer;
  1935.                         Inform : Boolean) : PreferencesPtr;
  1936.     External;
  1937.  
  1938.  
  1939. Procedure SetWindowTitles(window : WindowPtr;
  1940.                         WindowTitle, ScreenTitle : String);
  1941.     External;
  1942.  
  1943. Procedure ShowTitle(screen : ScreenPtr; ShowIt : Boolean);
  1944.     External;
  1945.  
  1946. Procedure SizeWindow(window : WindowPtr; DeltaX, DeltaY : Short);
  1947.     External;
  1948.  
  1949. Function SubNum(MenuNumber : Short) : Short;
  1950.     External;
  1951.  
  1952. Procedure UnlockIBase(Lock : Integer);
  1953.     External;
  1954.  
  1955. Function ViewAddress : ViewPtr;
  1956.     External;
  1957.  
  1958. Function ViewPortAddress(window : WindowPtr) : ViewPortPtr;
  1959.     External;
  1960.  
  1961. Function WBenchToBack : Boolean;
  1962.     External;
  1963.  
  1964. Function WBenchToFront : Boolean;
  1965.     External;
  1966.  
  1967. Function WindowLimits(window : WindowPtr; MinWidth, MinHeight,
  1968.                         MaxWidth, MaxHeight : Short) : Boolean;
  1969.     External;
  1970.  
  1971. Procedure WindowToBack(window : WindowPtr);
  1972.     External;
  1973.  
  1974. Procedure WindowToFront(window : WindowPtr);
  1975.     External;
  1976.  
  1977.  
  1978.  
  1979. { --- functions in V36 OR higher (distributed as Release 2.0) ---  }
  1980.  
  1981. FUNCTION QueryOverscan(DisplayID : Integer; rect : RectAnglePtr; oScanType : Short) : Integer;
  1982.  External;
  1983.  
  1984. PROCEDURE MoveWindowInFrontOf(win : WindowPtr; behindWin : WindowPtr);
  1985.  External;
  1986.  
  1987. PROCEDURE ChangeWindowBox(win : WindowPtr;left,top,width,height : Short);
  1988.  External;
  1989.  
  1990. FUNCTION SetEditHook(h : HookPtr): HookPtr;
  1991.  External;
  1992.  
  1993. FUNCTION SetMouseQueue(win : WindowPtr; queueLength : Short) : Integer;
  1994.  External;
  1995.  
  1996. PROCEDURE ZipWindow(Win : windowPtr);
  1997.  External;
  1998.  
  1999. FUNCTION LockPubScreen(name : String) : ScreenPtr;
  2000.  External;
  2001.  
  2002. PROCEDURE UnlockPubScreen(name : String; Scr : screenPtr);
  2003.  External;
  2004.  
  2005. FUNCTION LockPubScreenList : ListPtr;
  2006.  External;
  2007.  
  2008. PROCEDURE UnlockPubScreenList;
  2009.  External;
  2010.  
  2011. FUNCTION NextPubScreen(Scr : screenPtr; VAR namebuf : String) : String;
  2012.  External;
  2013.  
  2014. PROCEDURE SetDefaultPubScreen(name : String);
  2015.  External;
  2016.  
  2017. FUNCTION SetPubScreenModes(modes : Short) : Short;
  2018.  External;
  2019.  
  2020. FUNCTION PubScreenStatus(Scr : screenPtr; statusFlags : Short) : Short;
  2021.  External;
  2022.  
  2023. FUNCTION ObtainGIRPort(gInfo : GadgetInfoPtr) : RastPortPtr;
  2024.  External;
  2025.  
  2026. PROCEDURE ReleaseGIRPort(rp : RastPortPtr);
  2027.  External;
  2028.  
  2029. PROCEDURE GadgetMouse(gad : GadgetPtr;gInfo : GadgetInfoPtr; mousePoint : Short);
  2030.  External;
  2031.  
  2032. PROCEDURE GetDefaultPubScreen(VAR nameBuffer : String);
  2033.  External;
  2034.  
  2035. FUNCTION EasyRequestArgs(win : WindowPtr;ES : EasyStructPtr; idcmp : Integer; args: Address) : WindowPtr;
  2036.  External;
  2037.  
  2038. FUNCTION BuildEasyRequestArgs(Win : WindowPtr;ES : easyStructPtr;idcmp : Integer; args : Address) : WindowPtr;
  2039.  External;
  2040.  
  2041. FUNCTION SysReqHandler(Win : windowPtr; idcmp : Integer; waitInput : Boolean) : Integer;
  2042.  External;
  2043.  
  2044. FUNCTION OpenWindowTagList(nw : newWindowPtr; TagList : Address) : WindowPtr;
  2045.  External;
  2046.  
  2047. FUNCTION OpenScreenTagList(ns : newScreenPtr; tagList : Address) : ScreenPtr;
  2048.  External;
  2049.  
  2050. PROCEDURE DrawImageState(rp : RastPortPtr; im : ImagePtr; leftOffset,topOffset : Short; state : Integer; di : Address);
  2051.  External;                                                                                               { DrawInfoPtr }
  2052.  
  2053. FUNCTION PointInImage(p : point; im : imagePtr) : Boolean;
  2054.  External;
  2055.  
  2056. PROCEDURE EraseImage(rp : RastPortPtr; im : imagePtr; leftOffset,topOffset : Short);
  2057.  External;
  2058.  
  2059. FUNCTION NewObjectA(class : IClassPtr; classID : String; tagList : Address) : Address;
  2060.  External;
  2061.  
  2062. PROCEDURE DisposeObject(object : Address);
  2063.  External;
  2064.  
  2065. FUNCTION SetAttrsA(object : Address; tagList : Address) : Integer;
  2066.  External;
  2067.  
  2068. FUNCTION GetAttr(attrID : Integer; object : Address; storage : Address) : Integer;
  2069.  External;
  2070.  
  2071. FUNCTION SetGadgetAttrsA(Gad : gadgetPtr; Win : windowPtr; Req : requesterPtr; tagList : Address) : Integer;
  2072.  External;
  2073.  
  2074. FUNCTION NextObject(object : Address) : Address;
  2075.  External;
  2076.  
  2077. FUNCTION MakeClass(classID : String; superClassID : String; superClass : IClassPtr; instanceSize : Short; flags : Integer) : IClassPtr;
  2078.  External;
  2079.  
  2080. PROCEDURE AddClass(class : IClassPtr);
  2081.  External;
  2082.  
  2083. FUNCTION GetScreenDrawInfo(Scr : screenPtr) : Address;
  2084.  External;                                    { DrawInfoPtr }
  2085.  
  2086. PROCEDURE FreeScreenDrawInfo(Scr : screenPtr; di : Address);
  2087.  External;                                         { DrawInfoPtr }
  2088.  
  2089. FUNCTION ResetMenuStrip(Win : windowPtr; m : menuPtr) : Boolean;
  2090.  External;
  2091.  
  2092. PROCEDURE RemoveClass(class : IClassPtr);
  2093.  External;
  2094.  
  2095. FUNCTION FreeClass(class : IClassPtr) : Boolean;
  2096.  External;
  2097.  
  2098. { --- functions in V39 or higher (Release 3) --- }
  2099.  
  2100. FUNCTION AllocScreenBuffer(Scr : ScreenPtr; BM : BitMapPtr; 
  2101.                            flags : Integer) : ScreenBufferPtr;
  2102.     External;
  2103.  
  2104. PROCEDURE FreeScreenBuffer(Scr : Screen; sb : ScreenBufferPtr);
  2105.     External;
  2106.  
  2107. FUNCTION ChangeScreenBuffer(Scr : ScreenPtr; sb : ScreenBufferPtr) : Integer;
  2108.     External;
  2109.  
  2110. PROCEDURE ScreenDepth(Scr : ScreenPtr; flags : Integer; Reserved : Address);
  2111.     External;
  2112.  
  2113. PROCEDURE ScreenPosition(Scr : ScreenPtr; flags, x1, y1, x2, y2 : Integer);
  2114.     External;
  2115.  
  2116. PROCEDURE LendMenus(FromWin, ToWin : WindowPtr);
  2117.     External;
  2118.  
  2119. FUNCTION DoGadgetMethodA(Gad : GadgetPtr; Win : WindowPtr; Req : RequesterPtr;
  2120.                          Msg : Message) : Integer;
  2121.     External;
  2122.  
  2123. PROCEDURE SetWindowPointerA(Win : WindowPtr; TagList : Address);
  2124.     External;
  2125.  
  2126. FUNCTION TimedDisplayAlert(Alertnumber : Integer; Str : String;
  2127.                            height, time : Integer) : Boolean;
  2128.     External;
  2129.  
  2130. PROCEDURE HelpControl(Win : WindowPtr; flags : Integer);
  2131.     External;
  2132.  
  2133.  
  2134.